<template>
  <div class="cart">
    <nav-bar class="nav-bar">
      <div slot="center">购物车({{length}})</div>
    </nav-bar>
    <!-- 商品的列表 -->
    <cart-list />

    <!-- 底部的汇总 -->
    <cart-bottom-bar class="bottom-bar" />
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import NavBar from "@/components/common/navbar/NavBar";
import CartList from "./childCmps/CartList";
import CartBottomBar from "./childCmps/CartBottomBar";
export default {
  name: "Home",
  components: {
    NavBar,
    CartList,
    CartBottomBar,
  },
  data() {
    return {};
  },
  computed: {
    ...mapGetters({
      length: "cartLength",
    }),
  },
};
</script>
<style scoped>
.nav-bar {
  background-color: var(--color-tint);
  font-size: 16px;
  color: #fff;
}

.bottom-bar {
  height: 40px;
  background-color: #fff;
  position: relative;
}
</style>
